package gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;

@SuppressWarnings("serial")
public class SplashScreen extends JFrame {

    private JPanel contentPane;
    private JPanel panel;
    private JProgressBar progressBar;
    private JLabel lblStarter;
    private JLabel lblTlmodighedUdb;
    private JLabel lblInitialicereJpa;

    
    /**
     * Create the frame.
     */
    public SplashScreen() {
        initComponents();
    }
    private void initComponents() {
        setTitle("Starter...");
        setUndecorated(true);
        setAlwaysOnTop(true);
        setResizable(false);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setSize(325, 140);
        this.contentPane = new JPanel();
        this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        this.contentPane.setLayout(new BorderLayout(0, 0));
        setContentPane(this.contentPane);
        this.contentPane.add(getPanel(), BorderLayout.CENTER);
    }

    private JPanel getPanel() {
        if (panel == null) {
        	panel = new JPanel();
        	panel.setBorder(new CompoundBorder(new LineBorder(new Color(0, 0, 0), 1, true), new EmptyBorder(10, 10, 10, 10)));
        	GridBagLayout gbl_panel = new GridBagLayout();
        	gbl_panel.columnWidths = new int[]{269, 0};
        	gbl_panel.rowHeights = new int[]{0, 0, 0, 0, 0};
        	gbl_panel.columnWeights = new double[]{0.0, Double.MIN_VALUE};
        	gbl_panel.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
        	panel.setLayout(gbl_panel);
        	GridBagConstraints gbc_lblStarter = new GridBagConstraints();
        	gbc_lblStarter.weightx = 1.0;
        	gbc_lblStarter.insets = new Insets(0, 0, 5, 0);
        	gbc_lblStarter.gridx = 0;
        	gbc_lblStarter.gridy = 0;
        	panel.add(getLblStarter(), gbc_lblStarter);
        	GridBagConstraints gbc_progressBar = new GridBagConstraints();
        	gbc_progressBar.weightx = 1.0;
        	gbc_progressBar.fill = GridBagConstraints.HORIZONTAL;
        	gbc_progressBar.insets = new Insets(0, 0, 5, 0);
        	gbc_progressBar.gridx = 0;
        	gbc_progressBar.gridy = 1;
        	panel.add(getProgressBar(), gbc_progressBar);
        	GridBagConstraints gbc_lblTlmodighedUdb = new GridBagConstraints();
        	gbc_lblTlmodighedUdb.weightx = 1.0;
        	gbc_lblTlmodighedUdb.insets = new Insets(0, 0, 5, 0);
        	gbc_lblTlmodighedUdb.gridx = 0;
        	gbc_lblTlmodighedUdb.gridy = 2;
        	panel.add(getLblTlmodighedUdb(), gbc_lblTlmodighedUdb);
        	GridBagConstraints gbc_lblInitialicereJpa = new GridBagConstraints();
        	gbc_lblInitialicereJpa.weightx = 1.0;
        	gbc_lblInitialicereJpa.gridx = 0;
        	gbc_lblInitialicereJpa.gridy = 3;
        	panel.add(getLblInitialicereJpa(), gbc_lblInitialicereJpa);
        }
        return panel;
    }
    private JProgressBar getProgressBar() {
        if (progressBar == null) {
        	progressBar = new JProgressBar();
        	progressBar.setIndeterminate(true);
        }
        return progressBar;
    }
    private JLabel getLblStarter() {
        if (lblStarter == null) {
        	lblStarter = new JLabel("Starter " + MainFrame2.applicationName);
        }
        return lblStarter;
    }
    private JLabel getLblTlmodighedUdb() {
        if (lblTlmodighedUdb == null) {
        	lblTlmodighedUdb = new JLabel("T\u00E5lmodighed udbedes");
        }
        return lblTlmodighedUdb;
    }
    private JLabel getLblInitialicereJpa() {
        if (lblInitialicereJpa == null) {
        	lblInitialicereJpa = new JLabel("Initialicere JPA...");
        }
        return lblInitialicereJpa;
    }
}
